<?php
  include "include/config.inc.php";
  echo $deleteLoan = "DELETE FROM loandraw
                  WHERE loanDrawId = ".$_REQUEST['loanId'];
  $deleteLoanRes = mysql_query($deleteLoan);
  if($deleteLoanRes)
  {
   	echo $deleteinstallment = "DELETE FROM drawinstallment 
  	                        WHERE loanDrawId = ".$_REQUEST['loanId'];
  	$deleteinstallmentRes = mysql_query($deleteinstallment);
  	if(!$deleteinstallmentRes)
  	{
  		echo "Delete Fail";
  	}
  	else
  	{
  		header("Location:displayLoanDraw.php");
  	}
  }
  else
  {
  	header("Location:displayLoanDraw.php");
  }
?>